<div class="input-group stream-privacy-values">
    <div class="alert stream-privacy-status"></div>
    <label>{{t 'Who can access the stream?'}}
        {{> ../help_link_widget link="/help/stream-permissions" }}
    </label>

    <div class="stream-privacy_choices prop-element" id="id_stream_privacy" data-setting-widget-type="radio-group" data-setting-choice-type="string">
        {{#each stream_privacy_policy_values}}
            <div class="settings-radio-input-parent">
                <label class="radio">
                    <input type="radio" name="privacy" value="{{ this.code }}" {{#if (eq this.code ../stream_privacy_policy) }}checked{{/if}} />
                    <b>{{ this.name }}:</b> {{ this.description }}
                </label>
            </div>
        {{/each}}
    </div>
</div>

<div class="default-stream">
    {{> ../settings/settings_checkbox
      prefix="id_"
      setting_name="is_default_stream"
      is_checked=check_default_stream
      label="Default stream for new users"
      help_link="/help/set-default-streams-for-new-users"
      }}
</div>

<div class="input-group">
    <label class="dropdown-title">{{t 'Who can post to the stream?'}}
        {{> ../help_link_widget link="/help/stream-sending-policy" }}
    </label>
    <select name="stream-post-policy" class="stream_post_policy_setting prop-element settings_select bootstrap-focus-style" id="id_stream_post_policy" data-setting-widget-type="number">
        {{#each stream_post_policy_values}}
            <option value="{{this.code}}" {{#if (eq this.code ../stream_post_policy) }}selected{{/if}}>
                {{ this.description}}
            </option>
        {{/each}}
    </select>
</div>

{{> ../dropdown_widget_with_label
  widget_name=can_remove_subscribers_setting_widget_name
  label=(t 'Who can unsubscribe others from this stream?')
  value_type="number"}}

{{#if (or is_owner is_stream_edit)}}
<div>
    <div class="input-group inline-block message-retention-setting-group time-limit-setting">
        <label class="dropdown-title">{{t "Message retention period" }}
            {{> ../help_link_widget link="/help/message-retention-policy" }}
        </label>

        {{> ../settings/upgrade_tip_widget}}

        <select name="stream_message_retention_setting"
          class="stream_message_retention_setting prop-element settings_select bootstrap-focus-style"
          id="id_message_retention_days"
          data-setting-widget-type="message-retention-setting">
            <option value="realm_default">{{t "Use organization level settings {org_level_message_retention_setting}" }}</option>
            <option value="unlimited">{{t 'Retain forever' }}</option>
            <option value="custom_period">{{t 'Custom' }}</option>
        </select>

        <div class="dependent-settings-block stream-message-retention-days-input">
            <label class="inline-block">
                {{t 'Retention period (days)' }}:
            </label>
            <input type="text" autocomplete="off"
              name="stream-message-retention-days"
              class="stream-message-retention-days message-retention-setting-custom-input time-limit-custom-input"
              id="stream_message_retention_custom_input" />
        </div>
    </div>
</div>
{{/if}}
